package com.ibeeking.found.msg.api.feign.fallback;

import com.ibeeking.found.msg.api.common.dto.OssPolicyDto;
import com.ibeeking.found.msg.api.common.query.FileNameQuery;
import com.ibeeking.found.msg.api.feign.MsgFileFeignClient;
import com.ibeeking.nematos.utils.result.ResponseCodeEnum;
import com.ibeeking.nematos.utils.result.ResponseResult;
import feign.Response;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;


/**
 * 降级工场
 *
 * @Author ibeeking
 * @date 2019/1/18
 */
@Component
public class MsgFileFeignFallbackFactory implements FallbackFactory<MsgFileFeignClient> {
    @Override
    public MsgFileFeignClient create(Throwable throwable) {
        return new MsgFileFeignClient() {

            @Override
            public Response queryFile(FileNameQuery query) {
                return null;
            }
            @Override
            public ResponseResult<String> downloadFile(FileNameQuery query) {
                return null;
            }
            @Override
            public ResponseResult<String> uploadFile(MultipartFile file) {
                return null;
            }
            @Override
            public ResponseResult<OssPolicyDto>  policy() {return null;}
        };
    }
}
